Fix dev build: externalize ssh2 native deps#2
Conversation
The @agent-relay/sdk is bundled into main, which pulled ssh2 and its native cpu-features.node into the Vite SSR build and broke dev. Mark both as external so they load from node_modules at runtime. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Electron/Vite build configuration is updated to expand the Rollup external dependencies list for the main process. The ChangesBuild Configuration Update
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Fix #2: chunks that arrived mid-IPC stay in pending until the next rAF. If we capture writtenChunks before that flush, the subsequent subscribe replays them on top of the snapshot we just wrote — duplicate text. Expose flushPtyChunksNow(key) that cancels the pending rAF and runs flushPending synchronously, then call it in attachAndSeed right before reading getPtyChunks(key).length.
Summary
npm run devfailed withCould not resolve "../build/Release/cpufeatures.node"because@agent-relay/sdkis bundled into the main build and pulledssh2(and its nativecpu-features.node) along with it.ssh2andcpu-featurestorollupOptions.externalso they load fromnode_modulesat runtime, matching howwsis already handled.Test plan
npx electron-vite buildsucceedsnpm run devlaunches the app without the cpufeatures resolve error🤖 Generated with Claude Code